package model;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * TFrontUser entity. @author MyEclipse Persistence Tools
 */

public class TFrontUser implements java.io.Serializable {

	// Fields
	SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	
	private String username;
	private String pwd;
	private String realname;
	private String sex;
	private String phone;
	private String birthday;
	private String createtime;

	// Constructors

	/** default constructor */
	public TFrontUser() {
	}

	/** minimal constructor */
	public TFrontUser(String username) {
		this.username = username;
	}

	/** full constructor */
	public TFrontUser(String username, String pwd, String realname, String sex,
			String phone, String birthday, String createtime) {
		this.username = username;
		this.pwd = pwd;
		this.realname = realname;
		this.sex = sex;
		this.phone = phone;
		this.birthday = birthday;
		this.createtime = createtime;
	}

	// Property accessors

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPwd() {
		return this.pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getRealname() {
		return this.realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getBirthday() {
		return this.birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getCreatetime() {
		if (this.createtime != null && !this.createtime.equals("")) {
			Date date = Timestamp.valueOf(this.createtime);
			return formatter.format(date).toString();
		}
		return null;
	}

	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

}